<template>
    <a v-if="ishow" id="download-tip" class="tip-open-app" href="javascript:void(0)">
        <div>打开app</div>
    </a>
</template>
<style scoped>
.tip-open-app {
    position: fixed;
    right: 0;
    bottom: 120px;
    width: 110px;
    height: 38px;
    line-height: 38px;
    z-index: 10;
    opacity: .94;
    background-image: -webkit-linear-gradient(
316deg
,#ff6016f3,#ffb232 75%);
    background-image: linear-gradient(
134deg
,#ffb232,#ff6016f3 75%);
    box-shadow: 0 2px 4px 0 rgb(160 44 41 / 15%);
    border-radius: 20px 0 0 20px;
    display: -webkit-box;
    display: flex;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
}
.tip-open-app div {
    color: #fff;
    margin-left: 5px;
    font-size: 14px;
}
</style>
<script>
export default {
  data () {
    return {
      ishow: false
    }
  },
  mounted () {
    window.addEventListener('scroll', this.showlogo)
  },
  methods: {
    showlogo () {
      if ((window.document.documentElement.scrollTop || window.document.body.scrollTop) > ((window.document.documentElement.clientHeight) * 0.5)) { this.ishow = true } else {
        this.ishow = false
      }
    //   console.log(((window.document.documentElement.clientHeight) * 0.3))
    //   console.log(window.document.documentElement.scrollTop)
    }
  }
}
</script>
